package com.hero.feignClients;

import com.hero.domain.CourseIndex;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Feign远程调用search模块的客户端对象
 */
//@FeignClient(value = "search", fallback = SearchClientFallback.class)
@FeignClient(value = "search", fallbackFactory = SearchClientFallbackFactory.class)
public interface SearchClient {
    @PostMapping("/search/index/course")
    public Boolean add(@RequestBody CourseIndex courseIndex);

    @GetMapping("/search/index/getCourseById/{id}")
    public CourseIndex getCourseById(@PathVariable("id") Long id);

    /**
     * 根据课程id删除ES中的课程信息
     *
     * @param id
     * @return
     */
    @DeleteMapping("/search/index/delCourseById/{id}")
    public Boolean delCourseById(@PathVariable("id") Long id);

}